#pragma once

#include <QWidget>
#include "../Networks/GameNet/Server/GameServer.h"
#include <qtextedit.h>
#include <qqueue.h>
class GameServerWindow : public QWidget {
	Q_OBJECT;
public:
	GameServerWindow(QWidget* parent = nullptr);
	~GameServerWindow();
	void init();
signals:
	void readReady();
protected slots:
	void updateTextEdit();
	void doAcceptEvent(Connection* client, char* buffer);
private:
	GameServer* server;
	QTextEdit* content;

	QQueue<QString>* textQueue = new QQueue<QString>();

	volatile int seq = 0;
	volatile int count = 0;

	char data[1024] = { 1,'\0' };
};